package cn.train.controler;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.train.model.Ordertable;
import cn.train.model.UserTable;
import cn.train.service.VipCoderAndPassServices;

@WebServlet("/VipCoderServlet")
public class VipCoderServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {		
		VipCoderAndPassServices vaps=new VipCoderAndPassServices();
		HttpSession session=req.getSession();
		UserTable use=(UserTable)session.getAttribute("usertable");	
		String name = use.getUname();
		List<Ordertable> list=vaps.findByName(name);
		PrintWriter out =resp.getWriter();		
			req.setAttribute("list", list);	
		req.getRequestDispatcher("font/vip_coder.jsp").forward(req, resp);
	}
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		doGet(req, resp);
	}
}
